import axios from 'axios'

const get = ({url}) => {
    return new Promise((resolve,reject) => {
        axios({
            url
        })
        .then(result =>  resolve(result))
        .then(error => {
            reject(error)
        })
    })
}

const post = ({url},{data}) => {
  console.log(data)
  return new Promise((resolve, reject) => {
    axios.post(url, data)
      .then(response => {
        resolve(response.data)
      }, err => {
        reject(err)
      })
  })
}

export {
    get,
    post
    
}